package com.qiap;

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Singleton
@Named("transfer")
@Transactional
@Component
public class Transfer {

	private static final Logger logger = LoggerFactory
			.getLogger(Transfer.class);

	@Inject
	private JdbcTemplate jdbcTemplate;

	@Scheduled(cron = "0 46 19 * * *")
	public void task_CFETS_CRDTIBO() {

		pubTransTable("task_CFETS_CRDTIBO");
	}

	@Transactional
	public void pubTransTable(String msg) {
		try {
			String sql = "select 1 from dual";
			logger.debug(String.valueOf(jdbcTemplate.queryForInt(sql)));

		} catch (Exception e) {
			logger.error(e.getMessage());
		}
	}
}
